import _regeneratorRuntime from "@babel/runtime/regenerator";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _isEmpty from "lodash/isEmpty";

/**
 * 安全组维护 - 相关DS
 * @date: 2019-11-1

 */
import intl from 'utils/intl';
import { CODE_UPPER } from 'utils/regExp';
import { CPAAS_IAM, VERSION_IS_OP } from 'utils/config';
import { getCurrentOrganizationId, isTenantRoleLevel } from 'utils/utils';
import { validateDuplicate } from "../services/securityGroupService";
var CARD_MAX_HEIGHT = 200;
var organizationId = getCurrentOrganizationId();
var levelUrl = isTenantRoleLevel() ? "/".concat(organizationId) : ''; // 安全组列表

var secGrpDS = {
  transport: {
    read: function read(_ref) {
      var data = _ref.data,
          params = _ref.params;
      return {
        url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grps"),
        params: _objectSpread(_objectSpread({}, data), params),
        method: 'get'
      };
    },
    submit: function submit(_ref2) {
      var data = _ref2.data,
          dataSet = _ref2.dataSet;
      var _dataSet$queryParamet = dataSet.queryParameter,
          queryParameter = _dataSet$queryParamet === void 0 ? {} : _dataSet$queryParamet;
      var roleId = queryParameter.roleId;
      return {
        url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grps/create"),
        data: _objectSpread(_objectSpread({}, data[0]), {}, {
          roleId: roleId
        })
      };
    }
  },
  queryParameter: {
    secGrpSource: 'self'
  },
  autoQuery: true,
  pageSize: 10,
  selection: false,
  primaryKey: 'secGrpId',
  fields: [{
    name: 'secGrpId',
    type: 'string'
  }, {
    name: 'secGrpCode',
    label: intl.get('ciam.securityGroup.model.securityGroup.code').d('安全组代码'),
    type: 'string',
    required: true,
    unique: true,
    maxLength: 60,
    validator: function () {
      var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, name) {
        var _data;

        var data, res;
        return _regeneratorRuntime.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                if (CODE_UPPER.test(value)) {
                  _context.next = 2;
                  break;
                }

                return _context.abrupt("return", intl.get('cpaas.common.validation.codeUpper').d('全大写及数字，必须以字母、数字开头，可包含“-”、“_”、“.”、“/”'));

              case 2:
                data = (_data = {}, _defineProperty(_data, name, value), _defineProperty(_data, "level", isTenantRoleLevel() ? 'organization' : 'site'), _defineProperty(_data, "tenantId", organizationId), _data);
                _context.next = 5;
                return validateDuplicate(data);

              case 5:
                res = _context.sent;

                if (!(!_isEmpty(res) && res.failed && res.message)) {
                  _context.next = 8;
                  break;
                }

                return _context.abrupt("return", intl.get('ciam.securityGroup.view.message.code.unique').d('安全组代码重复'));

              case 8:
                if (!(!_isEmpty(res) && res.success)) {
                  _context.next = 10;
                  break;
                }

                return _context.abrupt("return", true);

              case 10:
              case "end":
                return _context.stop();
            }
          }
        }, _callee);
      }));

      function validator(_x, _x2) {
        return _validator.apply(this, arguments);
      }

      return validator;
    }()
  }, {
    name: 'secGrpName',
    label: intl.get('ciam.securityGroup.model.securityGroup.name').d('安全组名称'),
    type: 'intl',
    required: true,
    maxLength: 60
  }, {
    name: 'levelMeaning',
    label: intl.get('ciam.securityGroup.model.securityGroup.level').d('层级'),
    type: 'string'
  }, {
    name: 'remark',
    label: intl.get('ciam.securityGroup.model.securityGroup.description').d('安全组描述'),
    type: 'intl',
    maxLength: 240
  }, {
    name: 'enabledFlag',
    label: intl.get('ciam.securityGroup.model.securityGroup.enabledFlag').d('是否启用'),
    type: 'number',
    falseValue: 0,
    trueValue: 1,
    defaultValue: 1
  }, {
    name: 'createRoleName',
    label: intl.get('ciam.securityGroup.model.securityGroup.secGrpSource').d('来源'),
    type: 'string'
  }, {
    name: 'tenantId',
    type: 'number'
  }],
  queryFields: [{
    name: 'secGrpCode',
    label: intl.get('ciam.securityGroup.model.securityGroup.code').d('安全组代码'),
    type: 'string'
  }, {
    name: 'secGrpName',
    label: intl.get('ciam.securityGroup.model.securityGroup.name').d('安全组名称'),
    type: 'string'
  }]
}; // 安全组分配角色

var assignRoleDS = function assignRoleDS(secGrpId) {
  return {
    transport: {
      read: function read(_ref3) {
        var data = _ref3.data,
            params = _ref3.params;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-role-assign/").concat(secGrpId, "/assigned-role"),
          params: _objectSpread(_objectSpread({}, data), params),
          method: 'get'
        };
      },
      destroy: function destroy(_ref4) {
        var data = _ref4.data;
        var roleIds = data.map(function (item) {
          return item.id;
        });
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-role-assign/").concat(secGrpId, "/recycle-role"),
          data: roleIds,
          method: 'delete'
        };
      }
    },
    autoQuery: true,
    pageSize: 10,
    fields: [{
      name: 'name',
      label: intl.get('ciam.roleManagement.model.roleManagement.name').d('角色名称'),
      type: 'string'
    }, {
      name: 'parentRoleName',
      label: intl.get('ciam.roleManagement.model.roleManagement.topRole').d('上级角色'),
      type: 'string'
    }, {
      name: 'tenantName',
      label: intl.get('ciam.roleManagement.model.roleManagement.tenant').d('所属租户'),
      type: 'string'
    }],
    queryFields: [{
      name: 'name',
      label: intl.get('ciam.roleManagement.model.roleManagement.name').d('角色名称'),
      type: 'string'
    }]
  };
}; // 详情页表单


var secGrpDetailDS = function secGrpDetailDS(id) {
  return {
    autoQuery: true,
    paging: false,
    selection: false,
    transport: {
      read: function read(_ref5) {
        var data = _ref5.data,
            params = _ref5.params;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grps/").concat(id),
          params: _objectSpread(_objectSpread({}, data), params),
          method: 'get'
        };
      },
      submit: function submit(_ref6) {
        var data = _ref6.data;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grps"),
          data: data[0],
          method: 'PUT'
        };
      }
    },
    fields: [{
      name: 'secGrpCode',
      label: intl.get('ciam.securityGroup.model.securityGroup.code').d('安全组代码'),
      type: 'string'
    }, {
      name: 'secGrpName',
      label: intl.get('ciam.securityGroup.model.securityGroup.name').d('安全组名称'),
      type: 'intl',
      required: true
    }, {
      name: 'levelMeaning',
      label: intl.get('ciam.securityGroup.model.securityGroup.level').d('层级'),
      type: 'string'
    }, {
      name: 'remark',
      label: intl.get('ciam.securityGroup.model.securityGroup.description').d('安全组描述'),
      type: 'intl'
    }, {
      name: 'createRoleName',
      label: intl.get('ciam.securityGroup.model.securityGroup.secGrpSource').d('来源'),
      type: 'string'
    }, {
      name: 'enabledFlag',
      label: intl.get('ciam.securityGroup.model.securityGroup.enabledFlag').d('是否启用'),
      type: 'number',
      falseValue: 0,
      trueValue: 1,
      defaultValue: 1
    }, {
      name: 'tenantId',
      type: 'number'
    }],
    queryFields: [{
      name: 'secGrpCode',
      label: intl.get('ciam.securityGroup.model.securityGroup.code').d('安全组代码'),
      type: 'string'
    }, {
      name: 'secGrpName',
      label: intl.get('ciam.securityGroup.model.securityGroup.name').d('安全组名称'),
      type: 'string'
    }]
  };
}; // 访问权限


var visitPermissionDS = function visitPermissionDS(secGrpId) {
  return {
    pageSize: 10,
    selection: false,
    checkField: 'checkedFlag',
    autoQuery: true,
    primaryKey: 'id',
    idField: 'id',
    parentField: 'parentId',
    expandField: 'expand',
    transport: {
      read: function read(_ref7) {
        var data = _ref7.data,
            params = _ref7.params;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-acls/").concat(secGrpId),
          params: _objectSpread(_objectSpread(_objectSpread({}, data), params), {}, {
            secGrpId: secGrpId,
            level: isTenantRoleLevel() ? 'organization' : 'site'
          }),
          method: 'get'
        };
      },
      submit: function submit(_ref8) {
        var data = _ref8.data;
        var addPermissionIds = [];
        var deletePermissionIds = [];

        if (data && data.length) {
          var ids = data.map(function (item) {
            return item.id;
          });
          addPermissionIds = ids.filter(function (item) {
            return item.checkedFlag === 'Y' && item.type === 'ps';
          });
          deletePermissionIds = ids.filter(function (item) {
            return item.checkedFlag === 'N' && item.type === 'ps';
          });
        }

        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-acls/").concat(secGrpId),
          data: {
            addPermissionIds: addPermissionIds,
            deletePermissionIds: deletePermissionIds
          }
        };
      }
    },
    fields: [{
      name: 'id',
      type: 'number'
    }, {
      name: 'name',
      label: intl.get("ciam.roleManagement.model.roleManagement.permissionSetName").d('权限层级名称'),
      type: 'string'
    }, {
      name: 'permissionType',
      label: intl.get("ciam.roleManagement.model.roleManagement.permission.Type").d('权限类型'),
      type: 'string'
    }, {
      name: 'checkedFlag',
      label: intl.get('cpaas.common.button.action').d('操作'),
      type: 'boolean',
      trueValue: 'Y',
      falseValue: 'N'
    }, {
      name: 'parentId',
      type: 'number',
      parentFieldName: 'id'
    }, {
      name: 'expand',
      label: intl.get('ciam.securityGroup.model.securityGroup.expandFlag').d('是否展开'),
      type: 'boolean',
      defaultValue: false
    }]
  };
}; // 字段权限列表


var fieldPermissionDS = {
  pageSize: 10,
  selection: false,
  autoQuery: true,
  primaryKey: 'id',
  fields: [{
    name: 'serviceName',
    label: intl.get('ciam.roleManagement.model.api.serviceName').d('服务名'),
    type: 'string'
  }, {
    name: 'fieldCount',
    label: intl.get('ciam.roleManagement.model.api.fieldCount').d('已配置'),
    type: 'number'
  }, {
    name: 'method',
    label: intl.get('ciam.roleManagement.model.api.method').d('请求方式'),
    type: 'string'
  }, {
    name: 'path',
    label: intl.get('ciam.roleManagement.model.api.path').d('请求路径'),
    type: 'string'
  }, {
    name: 'description',
    label: intl.get('ciam.roleManagement.model.api.description').d('请求描述'),
    type: 'string'
  }],
  queryFields: [{
    name: 'serviceNameLov',
    label: intl.get('ciam.roleManagement.model.api.serviceName').d('服务名'),
    type: 'object',
    lovCode: VERSION_IS_OP || isTenantRoleLevel() ? 'CADM.ROUTE.SERVICE_CODE.ORG' : 'CADM.ROUTE.SERVICE_CODE',
    noCache: true,
    ignore: 'always'
  }, {
    name: 'serviceName',
    type: 'string',
    bind: 'serviceNameLov.serviceCode'
  }, {
    name: 'method',
    label: intl.get('ciam.roleManagement.model.api.method').d('请求方式'),
    type: 'string',
    lookupCode: 'CIAM.REQUEST_METHOD'
  }, {
    name: 'path',
    label: intl.get('ciam.roleManagement.model.api.path').d('请求路径'),
    type: 'string'
  }, {
    name: 'description',
    label: intl.get('ciam.roleManagement.model.api.description').d('请求描述'),
    type: 'string'
  }]
}; // 字段权限侧滑

var fieldPermissionDrawerDS = {
  pageSize: 10,
  selection: false,
  autoQuery: true,
  fields: [{
    name: 'fieldLov',
    label: intl.get('ciam.roleManagement.model.fieldPermission.fieldName').d('字段名称'),
    type: 'object',
    lovCode: 'CIAM.SEC_GRP.FIELD.ASSIGNABLE',
    required: true,
    ignore: 'always',
    unique: true
  }, {
    name: 'fieldId',
    type: 'string',
    bind: 'fieldLov.fieldId'
  }, {
    name: 'fieldName',
    label: intl.get('ciam.roleManagement.model.fieldPermission.fieldName').d('字段名称'),
    type: 'string',
    bind: 'fieldLov.fieldName',
    ignore: 'always'
  }, {
    name: 'fieldTypeMeaning',
    label: intl.get('ciam.roleManagement.model.fieldPermission.fieldType').d('字段类型'),
    type: 'string',
    lookupCode: 'CIAM.FIELD.TYPE',
    bind: 'fieldLov.fieldType'
  }, {
    name: 'permissionType',
    label: intl.get('ciam.roleManagement.model.fieldPermission.rule').d('权限规则'),
    type: 'string',
    lookupCode: 'CIAM.FIELD.PERMISSION_TYPE',
    required: true
  }, {
    name: 'permissionTypeMeaning',
    ignore: 'always'
  }, {
    name: 'permissionRule',
    label: intl.get('ciam.roleManagement.model.fieldPermission.desensitize').d('脱敏规则'),
    type: 'string',
    dynamicProps: {
      required: function required(_ref9) {
        var record = _ref9.record;
        return record.get('permissionType') === 'DESENSITIZE';
      }
    }
  }, {
    name: 'remark',
    label: intl.get('ciam.securityGroup.model.securityGroup.remark').d('说明'),
    type: 'string'
  }, {
    name: 'editing',
    type: 'boolean',
    ignore: 'always'
  }],
  queryFields: [{
    name: 'fieldName',
    label: intl.get('ciam.roleManagement.model.fieldPermission.fieldName').d('字段名称'),
    type: 'string'
  }, {
    name: 'permissionType',
    label: intl.get('ciam.roleManagement.model.fieldPermission.rule').d('权限规则'),
    type: 'string',
    lookupCode: 'CIAM.FIELD.PERMISSION_TYPE'
  }]
}; // 工作台列表

var cardDS = {
  pageSize: 10,
  autoQuery: true,
  fields: [{
    name: 'cardLov',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardCode').d('卡片代码'),
    type: 'object',
    lovCode: isTenantRoleLevel() ? 'CPFM.ROLE_ASSIGN_CARD.ORG' : 'CPFM.ROLE_ASSIGN_CARD',
    lovPara: isTenantRoleLevel() ? {
      tenantId: organizationId
    } : {},
    ignore: 'always',
    required: true
  }, {
    name: 'cardId',
    type: 'number',
    bind: 'cardLov.cardId'
  }, {
    name: 'code',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardCode').d('卡片代码'),
    type: 'string',
    bind: 'cardLov.code'
  }, {
    name: 'name',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardName').d('卡片名称'),
    type: 'string',
    bind: 'cardLov.name'
  }, {
    name: 'catalogMeaning',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardType').d('卡片类别'),
    type: 'string',
    bind: 'cardLov.catalogMeaning'
  }, {
    name: 'h',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardH').d('高度'),
    type: 'number',
    bind: 'cardLov.h'
  }, {
    name: 'w',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardW').d('长度'),
    type: 'number',
    bind: 'cardLov.w'
  }, {
    name: 'x',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardX').d('位置X'),
    type: 'number',
    required: true,
    step: 1,
    min: 0,
    max: CARD_MAX_HEIGHT
  }, {
    name: 'y',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardY').d('位置Y'),
    type: 'number',
    required: true,
    step: 1,
    min: 0,
    max: CARD_MAX_HEIGHT
  }, {
    name: 'defaultDisplayFlag',
    label: intl.get('ciam.securityGroup.model.securityGroup.defaultDisplayFlag').d('是否初始化'),
    type: 'number',
    falseValue: 0,
    trueValue: 1,
    defaultValue: 1
  }, {
    name: 'remark',
    label: intl.get('cpaas.common.explain').d('说明'),
    type: 'string'
  }],
  queryFields: [{
    name: 'code',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardCode').d('卡片代码'),
    type: 'string'
  }, {
    name: 'name',
    label: intl.get('ciam.roleManagement.model.tenantAssignCards.cardName').d('卡片名称'),
    type: 'string'
  }]
}; // 数据权限维度

var dimensionDS = {
  pageSize: 10,
  selection: false,
  autoQuery: true,
  primaryKey: 'docTypeId',
  fields: [{
    name: 'docTypeName',
    label: intl.get('ciam.roleManagement.model.role.docType').d('单据'),
    type: 'string'
  }, {
    name: 'authScopeCode',
    label: intl.get('ciam.roleManagement.model.role.authRang').d('权限维度范围'),
    type: 'string',
    defaultValue: 'BIZ',
    lookUpCode: 'CIAM.AUTHORITY_SCOPE_CODE'
  }, {
    name: 'changingSourceList',
    type: 'object'
  }],
  queryFields: [{
    name: 'docTypeName',
    label: intl.get('ciam.roleManagement.model.role.docType').d('单据'),
    type: 'string'
  }]
}; // 分配角色添加角色弹窗

var addRoleDS = function addRoleDS(_ref10) {
  var secGrpId = _ref10.secGrpId;
  return {
    transport: {
      read: function read(_ref11) {
        var data = _ref11.data,
            params = _ref11.params;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-role-assign/").concat(secGrpId, "/assignable-role"),
          params: _objectSpread(_objectSpread({}, data), params),
          method: 'get'
        };
      },
      submit: function submit(_ref12) {
        var data = _ref12.data;
        var roleIds = data.map(function (item) {
          return item.id;
        });
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-role-assign/").concat(secGrpId, "/assign-role"),
          data: roleIds
        };
      }
    },
    autoQuery: true,
    selection: false,
    pageSize: 10,
    fields: [{
      name: 'isSelected',
      type: 'boolean',
      ignore: 'always'
    }, {
      name: 'name',
      label: intl.get('ciam.roleManagement.model.roleManagement.name').d('角色名称'),
      type: 'string'
    }, {
      name: 'code',
      label: intl.get('ciam.roleManagement.model.roleManagement.code').d('角色编码'),
      type: 'string'
    }, {
      name: 'tenantName',
      label: intl.get('ciam.roleManagement.model.roleManagement.tenantName').d('租户名称'),
      type: 'string'
    }],
    queryFields: [{
      name: 'name',
      label: intl.get('ciam.roleManagement.model.roleManagement.name').d('角色名称'),
      type: 'string'
    }, {
      name: 'code',
      label: intl.get('ciam.roleManagement.model.roleManagement.code').d('角色编码'),
      type: 'string'
    }, !isTenantRoleLevel() && {
      name: 'tenantLov',
      label: intl.get('ciam.roleManagement.model.roleManagement.tenantName').d('租户名称'),
      type: 'object',
      lovCode: 'CPFM.TENANT',
      ignore: 'always',
      noCache: true
    }, !isTenantRoleLevel() && {
      name: 'tenantId',
      label: intl.get('ciam.roleManagement.model.roleManagement.tenantName').d('租户名称'),
      bind: 'tenantLov.tenantId'
    }].filter(Boolean)
  };
}; // 数据权限除公司外的添加弹窗


var addModalDS = function addModalDS(_ref13) {
  var nameTitle = _ref13.nameTitle,
      codeTitle = _ref13.codeTitle,
      authorityTypeCode = _ref13.authorityTypeCode,
      secGrpId = _ref13.secGrpId,
      roleId = _ref13.roleId,
      secGrpSource = _ref13.secGrpSource;
  return {
    transport: {
      read: function read(_ref14) {
        var data = _ref14.data,
            params = _ref14.params;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-dcls/").concat(secGrpId, "/authority/assignable"),
          params: _objectSpread(_objectSpread(_objectSpread({}, data), params), {}, {
            roleId: roleId,
            authorityTypeCode: authorityTypeCode,
            secGrpSource: secGrpSource
          }),
          method: 'get',
          transformResponse: function transformResponse(res) {
            var newData = JSON.parse(res);
            return newData.secGrpDclLineList;
          }
        };
      },
      submit: function submit(_ref15) {
        var data = _ref15.data;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-dcls/").concat(secGrpId, "/authority?authorityTypeCode=").concat(authorityTypeCode),
          data: data
        };
      }
    },
    autoQuery: true,
    selection: false,
    pageSize: 8,
    dataKey: 'content',
    fields: [{
      name: 'isSelected',
      type: 'boolean',
      ignore: 'always'
    }, {
      name: 'tenantName',
      label: intl.get('cpaas.common.model.common.tenantId').d('租户'),
      type: 'string'
    }, {
      name: 'dataName',
      label: nameTitle,
      type: 'string'
    }, {
      name: 'dataCode',
      label: codeTitle,
      type: 'string'
    }, {
      name: 'secGrpId',
      type: 'string'
    }],
    queryFields: [{
      name: 'dataName',
      label: nameTitle,
      type: 'string'
    }, {
      name: 'dataCode',
      label: codeTitle,
      type: 'string'
    }]
  };
}; // 工作台-新建工作台弹窗


var addCardDS = function addCardDS(_ref16) {
  var roleId = _ref16.roleId,
      secGrpId = _ref16.secGrpId;
  return {
    transport: {
      read: function read(_ref17) {
        var data = _ref17.data,
            params = _ref17.params;
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-acl-dashboards/").concat(secGrpId, "/assignable"),
          params: _objectSpread(_objectSpread(_objectSpread({}, data), params), {}, {
            roleId: roleId
          }),
          method: 'get'
        };
      },
      submit: function submit(_ref18) {
        var data = _ref18.data;
        var selectedAddRows = data.map(function (item) {
          return _objectSpread(_objectSpread({}, item), {}, {
            x: 0,
            y: 0,
            defaultDisplayFlag: 0
          });
        });
        return {
          url: "".concat(CPAAS_IAM, "/v1").concat(levelUrl, "/sec-grp-acl-dashboards/").concat(secGrpId),
          data: selectedAddRows,
          method: 'post'
        };
      }
    },
    autoQuery: true,
    selection: false,
    pageSize: 8,
    fields: [{
      name: 'isSelected',
      type: 'boolean',
      ignore: 'always'
    }, {
      name: 'name',
      label: intl.get('ciam.roleManagement.model.roleManagement.cardName').d('卡片名称'),
      type: 'string'
    }, {
      name: 'code',
      label: intl.get('ciam.roleManagement.model.roleManagement.cardCode').d('卡片代码'),
      type: 'string'
    }, {
      name: 'catalogMeaning',
      label: intl.get('ciam.roleManagement.model.roleManagement.catalogMeaning').d('卡片类型'),
      type: 'string'
    }],
    queryFields: [{
      name: 'name',
      label: intl.get('ciam.roleManagement.model.roleManagement.cardName').d('卡片名称'),
      type: 'string'
    }, {
      name: 'code',
      label: intl.get('ciam.roleManagement.model.roleManagement.cardCode').d('卡片代码'),
      type: 'string'
    }]
  };
};

var roleLovDS = {
  autoCreate: true,
  fields: [{
    name: 'roleLov',
    lovCode: 'CIAM.CURRENT_TENANT_ROLES',
    required: true,
    type: 'object',
    label: intl.get('ciam.securityGroup.model.securityGroup.roleLov').d('当前角色'),
    ignore: 'always',
    noCache: true
  }, {
    name: 'roleName',
    type: 'string',
    bind: 'roleLov.name'
  }, {
    name: 'roleId',
    type: 'string',
    bind: 'roleLov.id'
  }]
};
export { secGrpDS, assignRoleDS, secGrpDetailDS, visitPermissionDS, fieldPermissionDS, fieldPermissionDrawerDS, cardDS, dimensionDS, addRoleDS, addModalDS, addCardDS, roleLovDS };